import request from '@/utils/request.js'
// 搜索售货机(售货机列表)
export function VmSearch ({ pageIndex, pageSize, status, innerCode }) {
  return request({
    url: '/vm-service/vm/search',
    method: 'GET',
    params: {
      pageIndex: pageIndex,
      pageSize: pageSize,
      status: status,
      innerCode: innerCode
    }
  })
}
// 新增售货机
export function VmShou (data) {
  return request({
    url: '/vm-service/vm',
    method: 'POST',
    data
  })
}
// 售货机类型列表搜索
export function VmLx () {
  return request({
    url: '/vm-service/vmType/search'
  })
}
// 修改售货机点位
export function VmXiuGai ({ id, nodeId }) {
  return request({
    url: `/vm-service/vm/${id}/${nodeId}`,
    method: 'PUT'
  })
}
// 策略列表
export function VmPoliy () {
  return request({
    url: '/vm-service/policy',
    method: 'GET'
  })
}
// 策略回显
export function VmIncode (innerCode) {
  return request({
    url: `/vm-service/policy/vmPolicy/${innerCode}`,
    method: 'GET'
  })
}
// 应用策略
export function VmAppPly (data) {
  return request({
    url: '/vm-service/vm/applyPolicy',
    method: 'PUT',
    data
  })
}
// 获取售货机详情
export function VmChanne (innerCode) {
  return request({
    url: `/vm-service/channel/channelList/${innerCode}`,
    method: 'GET'
  })
}
// 售货机类型详情
export function VmType (typeId) {
  return request({
    url: `/vm-service/vmType/${typeId}`
  })
}
